home *** CD-ROM | disk | FTP | other *** search
- Our project needed a smarter help - one where we could back up using
- Alt-F1 from a previous help. The functionality we decided upon uses a
- 'fence'. That is the lowest level of help is a table of contenets and
- is always available - it is 'fenced' from change. To do this, we
- preload the lowest level of help: .topic Nocontext=0. This topic is set
- up as a table of contents. Since it is defined as level '0', it also
- becomes the default help screen. Each time a 'hypertext' link is
- invoked, Alt-F1 will return you to the previous level, loosing the
- reference from which you just came. This seems to be the same
- functionality of the Borland help and that of the Micosoft Quick Help.
-
- We did decide to reinitialize on each entry to the help system. Thus
- multiple entries to the help system would, at first, provide the table
- of contents if Alt-F1 is invoked rather that some previous help screen
- you've viewed.
-
- The implementation uses a stack of fixed size. Imagine what you should
- do when entering a new link:
-
- Save the current context in the stack and move to the next topic.
-
- This implies storing the 'current' context so it can be saved on the
- stack when the next topic is entered. Now when the stack is popped,
- you'll get the previous context.
-
- The context information is just an integer help value: hcXXX as
- produced by TVHC.EXE. The stack is an array of integers. An alternate
- implementation might abstract this with templates and a dynamic array.
- I decided to cut to the chase.
-
- (By the way, I modified tvhc.cpp so lines in a help text file beginning
- with ';' are treated as comments. We decided comments in the help file
- might be good).
-
- To keep the changes localized, I added the Stack class local to
- help.cpp.
-
- There are two files here.
-
- help.dif - is a diff file between help.cpp and my version. (If
- you ever do things in Unix and do not have the MKS
- tool-kit I have pitty).
-
- help.cpp - my modified version.
-
- Excuse the lack of comments in the source file. Some years ago I
- noticed that none of the compilers I use correctly compile comments.
- Instead they were ignored! Thus non-sense comments seemed to compile
- just as well as correct ones. We need smarter compilers :-).
-
-
- Dave Hillman
- 74045,1127
- July 13, 1992
-
-
-
- Dave Hillman